<?php

namespace app\common\model;

class BookModel extends CommonModel
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'book';

    /**
     * 初始化方法
     * {@inheritDoc}
     * @see CommonModel::initialize()
     */
    protected function initialize()
    {
        parent::initialize();
    }

    /**
     * 获取需要检测更新的数据列表
     */
    public function get_new_to_update()
    {
        $start_time = date( 'Y-m-d H:i:s', time() - ( 86400 * 10 ) );

        $where = array(
            "is_over" => 0,
            "last_update_time" => [
                "gt", $start_time
            ]
        );

        $list = $this->where( $where )->column( "id,url" );
        return $list;
    }

}
